package com.cloud.api.mock;

import com.weng.cloud.commons.base.TimeUtil;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: weng
 * @Date: 2022/6/11
 * @Description: com.weng.cloud.service8881.mock
 */

public interface MockConstants {

    String URL = "http://weng-cloud-service-8882/mockService";

    String text = "2021-12-01";

    String[] ARG = new String[]{
            "Java并发编程实战",
            "spring cloud netflix",
            "sie and honor",
            "mongodb",
            "mock",
            "spring cloud alibaba",
            "redisson"
    };

    static List<MockResDto> res(List<MockArgDto> argDtos) {
        return argDtos.stream().map(argDto -> MockResDto.builder()
                .content(argDto.getContent())
                .year(TimeUtil.year(argDto.getDate()))
                .month(TimeUtil.month(argDto.getDate()))
                .build()
        ).collect(Collectors.toList());
    }
}
